#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2018, Intel Corporation
#
#
# pmempool_create/TEST0 -- test for creating pool with specified permissions
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

setup

POOL=$DIR/file.pool

# PMEMBLK
expect_normal_exit $PMEMPOOL$EXESUFFIX create -m 0666 blk 512 $POOL
check_file $POOL
check_signature PMEMBLK $POOL
check_mode 666 $POOL

# PMEMLOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create -m 0555 log $POOL
check_file $POOL
check_signature PMEMLOG $POOL
check_mode 555 $POOL

# PMEMOBJ
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create -m 0556 --layout=LAYOUT_NAME$SUFFIX obj $POOL
check_file $POOL
check_signature PMEMOBJ $POOL
check_layout LAYOUT_NAME$SUFFIX $POOL
check_mode 556 $POOL

pass
